package com.cet.base;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @program: cet-practice
 * @description:
 * @author: 陈恩涛
 * @create: 2023-03-27 10:18
 **/
public class RegexTest {
    public static void main(String[] args) {

//        String id18 ="^[1-9][0-9]{5}(18|19|20)[0-9]{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)[0-9]{3}([0-9]|(X|x))";

        String ID_CARD_PATTERN = "^\\d{17}([0-9]|X|x)$";
        Pattern pattern = Pattern.compile(ID_CARD_PATTERN);
        Matcher matcher = pattern.matcher("342623199801044811");
        System.out.println(matcher.matches());
    }
}
